www.gusucode.com > 6KBBS ASP版 V7.1 > 6KBBS ASP版 V7.1\code\bbs\admin\AdminRight3.asp

    <!--#include file="AdminConn.asp"--><!--#include file="../inc/fun.asp"--><!--#include file="../inc/md5.asp"-->
<%dim action,strt,i,lgname,lgpwd,lgpwdmd5,lguserid,touserid,usedtable,usetable,using,table,canadd,totable,tablestr,autotable,usedtable1,sql,bd
lgname=replace(session(prefix&"adlgname"),"'","''")
lgpwd=replace(session(prefix&"adlgpwd"),"'","''")
if isnull(lgname) or lgname="" or isnull(lgpwd) or lgpwd="" then
	response.redirect"admincheck.asp"
else
	lgpwdmd5=md5(lgpwd)
	if conn.execute("select top 1 bd from admin where name='"&lgname&"' and password='"&lgpwdmd5&"' and bd=0").eof then
		response.redirect"admincheck.asp"
	end if
end if
lguserid=checknum(session(prefix&"lguserid"))
action=request.querystring("action")
select case action
case"sms","deloldsms","delusersms" strt="论坛留言管理"
case"sendsms","savesms" strt="群发留言"
case"table","updatetable","addtable","deltable" strt="论坛帖子数据表管理"
case"recycle","delbbsgg" strt="论坛回收站"
end select
sub send(str)
response.write"<table border=1 cellpadding=0 cellspacing=0 style='border-collapse: collapse' bordercolor=#F4F6FC width=100% bgcolor=#ffffff height=50><tr><td width=100% ><p style='margin:5px;line-height:150%'>"&str&"</p></td></tr></table>"
end sub
%>
<link rel=stylesheet type=text/css href=pic/css.css>
<STYLE type=text/css>
BODY {
	SCROLLBAR-FACE-COLOR:#205CC1; FONT: 9pt 宋体; SCROLLBAR-HIGHLIGHT-COLOR: #799ae1; SCROLLBAR-SHADOW-COLOR: #799ae1; SCROLLBAR-3DLIGHT-COLOR: #799ae1; SCROLLBAR-ARROW-COLOR: #ffffff; SCROLLBAR-TRACK-COLOR: #aabfec; SCROLLBAR-DARKSHADOW-COLOR: #799ae1
}
.pagestr{width:100%;height:30px; background-color:#F4F6FC;padding:4px;}
</style>
<body bgcolor="#D6DFF7" leftmargin="15"  rightmargin="15">
<table border="0" cellpadding="0" style="border-collapse: collapse" width="100%" id="table7" height="18">
	<tr>
		<td align="right"> </td>
	</tr>
</table>

<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="100%" bgcolor="#1C58C9">
  <tr>
    <td class=td1 height="30" align="center" background="pic/lbg.gif" bgcolor="#1C58C9"><%=strt%></td>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#1C58C9" width="100%" bgcolor=#ffffff>
  <tr>
    <td width="100%" valign="top">
<%
select case action
case"sms"
%><br><form method="POST" action="adminright3.asp?action=deloldsms">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
  <tr>
    <td class=td3 colspan=2>删除所有已读的留言:</td>
  </tr>
  <tr>
    <td class=td2 width="30%" height="40" bgcolor="#F4F6FC">
    <p style="margin: 6">删除所有已读的留言:<br>确实要删除,请输入<font color="#FF0000">ok</font>。</td>
    <td width="70%" bgcolor="#F4F6FC">
    <input type="text" name="ok" size="20">&nbsp; 
    <input type="submit" value=" 确  认  删  除 " name="B1"></td>
  </tr>
  </table></form>
  <form method="POST" action="adminright3.asp?action=delusersms">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
    <tr>
    <td class=td3 colspan=2>删除指定用户的所有留言:</td>
  </tr>
  <tr>
    <td class=td2 width="30%" height="40" bgcolor="#F4F6FC">
    <p style="margin: 6">删除指定用户的留言:( 用户名 )</td>
    <td width="70%" bgcolor="#F4F6FC">
    <input type="text" name="name" size="20">&nbsp; <input type="submit" value=" 确  认  删  除 " name="B1"></td>
  </tr>
  </table></form>
<%case"deloldsms"
dim ok
ok=Replace(Request.Form("ok"),"'","")
if ok="ok" then
conn.execute("delete*from sms where new=false")
call send("删除已读留言成功。")
else
call send("删除已读留言失败。")
end if

case"delusersms"
dim name,userid
name=Replace(Request.Form("name"),"'","")
set rs=conn.execute("select top 1 userid from [user] where name='"&name&"'")
if rs.eof then
call send("·论坛不存在该用户<br>·<a href='javascript:history.go(-1)'><span class=errfont>返回重新填写</span></a>")
else
userid=rs(0)
conn.execute("delete*from sms where touserid="&userid&"")
call send("删除 "&checktitle(name)&" 的留言成功。")
end if
set rs=nothing
%>
<%case"sendsms"%>
<SCRIPT>
function checkeditor(editor)
{
if(editor=="html")
	{
				document.getElementById("ubbeditordiv").style.display = 'none';
				document.getElementById("htmltoolbar").style.display = 'block';
				EDITFORM_DOCUMENT.body.innerHTML = document.getElementById("CodeForm").value;
				document.getElementById("editTextarea").style.display = 'none';
				document.getElementById("editIframe").style.display = 'block';
				HtmlDisableToolbar(false);
	}
else if(editor=="ubb")
	{
				document.getElementById("ubbeditordiv").style.display = 'block';
				document.getElementById("htmltoolbar").style.display = 'none';
				document.getElementById("CodeForm").value = HtmlHtmlToXhtml(EDITFORM_DOCUMENT.body.innerHTML);
				document.getElementById("editIframe").style.display = 'none';
				document.getElementById("editTextarea").style.display = 'block';
				HtmlDisableToolbar(true);
	}
}

function preview()
{
if(htmlsubmit()){
document.form1.topic.value=document.topicform.ggtitle.value;
document.form1.content.value=document.topicform.content.value;
var popupWin = window.open('../paper.asp?action=preview', 'showgg', 'width=500,height=400,resizable=1,scrollbars=yes,menubar=no,status=yes');
document.form1.submit()
}
}



</SCRIPT>

<form method="POST" action="adminright3.asp?action=savesms" name="topicform">

    <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="100%" bordercolor="#F4F6FC">
      <tr>
        <td class=td2 width="100%" height="32" colspan="2" bgcolor="#F4F6FC">
        &nbsp;<font color="#FF0000">注意:该操作将会占用很大系统资源,请慎用。</font></td>
      </tr>
      <tr>
        <td class=td2 width="25%" height="32">
        <p style="line-height: 120%; margin: 4">留言对象:</td>
        <td width="75%">
        <p style="line-height: 120%; margin: 4">
        <select style="FONT-SIZE: 9pt" name="toname">
        <option value="0" selected>所有在线用户</option>
        <option value="1">所有版主</option>
        <option value="2">所有超级版主</option>
        <option value="3">所有管理员</option>
        <option value="4">所有Vip用户</option>
        <option value="5">所有注册用户</option>
        </select><input type="hidden" name="ggtitle" size="20" value="群发留言"></td>
      </tr>
      <tr>
        <td  valign="top" width="200">
        <p style="line-height: 150%; margin: 5"><b><font color="#0466CC">留言内容:</font></b><br>
		<input type="radio" name="usereditor" value="html" onclick="checkeditor('html')" checked>使用Html编辑器<br>
		<input type="radio" name="usereditor" value="ubb" onclick="checkeditor('ubb')">使用UBB编辑器<br>

</td>
<td valign="top" style="padding:5px;">
<input name=content type="hidden">
<SCRIPT src="../Editor/Ubb/UbbEditor.js"></SCRIPT>
<script type="text/javascript" src="../Editor/Html/htmlEditor.js"></script>

<script>

var ubbedit=new UbbEditor("CodeForm",100,14,"default values","../editor/ubb/images/");
ubbedit.showeditor();
</script>


<script type="text/javascript">
var editor = new htmlEditor("editor");
editor.hiddenName = "content";
editor.width = "100%";
editor.height = "300px";
editor.imagePath="../editor/html/images/";
editor.iconPath = '../editor/html/images/face/';
editor.show();

var strlength;

//提交表单
function submitform(){
   	if(htmlsubmit())
   		{document.topicform.submit();}
}

//检测表单
function htmlsubmit() {
	if(document.getElementsByName("usereditor").item(0).checked==true){
		var content = editor.data();
	}
	else if(document.getElementsByName("usereditor").item(1).checked==true){
		checkeditor("html");
		var content = editor.data();
		checkeditor("ubb");
	}
	
		strlength=document.getElementsByName("content").item(0).value.length;
		if (strlength>25600||strlength<5){
			alert("您输入的文章长度为"+strlength+",长度必须大于5且小于25600,请修正之后再继续。");
			return false;
		}
		else if(document.getElementsByName("ggtitle").item(0).value==""){
			alert("标题不能为空。");
			document.getElementsByName("ggtitle").item(0).focus();
			return false;
		}
		else{
			return true;
		}
}

</script>

</td>
      </tr>
      <tr>
        <td colspan="2" align="center" height="40" bgcolor="#F4F6FC">
        <input class=submit type=button value=OK_!发送 name=B1 onclick="submitform()">&nbsp;&nbsp;&nbsp; <input class=submit type=button value="预  览!" onclick=preview()>&nbsp;&nbsp;&nbsp; <input class=submit type=reset value=NO_!重写 name=B2>&nbsp; [ 按 Alt+Enter 直接发送 ]</td>
      </tr>
      </table>
</div>
</form>
<form name=form1 action=../paper.asp?action=preview method=post target=showgg>
<input type=hidden name=topic value=><input type=hidden name=content value=>
</form>
<%case"savesms"
dim bad,b,toname,content,contentok,content2
toname=checknum(request.form("toname"))

function checkbad(str)
if isnull(str) then exit function 
bad=split(application(prefix&"badcontent"), "|")
for b=0 to ubound(bad)
str=Replace(str,bad(b),string(len(bad(b)),"*")) 
next
checkbad=str
end function

content=checkbad(Request.Form("content"))
content=replace(content,"|","│")
content=replace(content,"'","''")
contentok=Replace(content," ","")
content2=content&"|"&now()+timeset/24
if toname="" or contentok="" then
call send("·请填写完整留言对象和留言内容<br>·<a href='javascript:history.go(-1)'><span class=errfont>返回重新填写</span></a>")
else
select case toname

case 0
set rs=conn.execute("select userid from online where userid<>0")
do while not rs.eof
conn.execute("insert into sms(fromuserid,touserid,content) values("&lguserid&","&rs("userid")&",'"&content2&"')")
rs.movenext
loop
set rs=nothing

case 1
set rs=conn.execute("select userid from [user] where grade=14")
do while not rs.eof
conn.execute("insert into sms(fromuserid,touserid,content) values("&lguserid&","&rs("userid")&",'"&content2&"')")
rs.movenext
loop
set rs=nothing

case 2
set rs=conn.execute("select userid from [user] where grade=15")
do while not rs.eof
conn.execute("insert into sms(fromuserid,touserid,content) values("&lguserid&","&rs("userid")&",'"&content2&"')")
rs.movenext
loop
set rs=nothing

case 3
set rs=conn.execute("select userid from [user] where grade=16")
do while not rs.eof
conn.execute("insert into sms(fromuserid,touserid,content) values("&lguserid&","&rs("userid")&",'"&content2&"')")
rs.movenext
loop
set rs=nothing

case 4
set rs=conn.execute("select userid from [user] where grade=13")
do while not rs.eof
conn.execute("insert into sms(fromuserid,touserid,content) values("&lguserid&","&rs("userid")&",'"&content2&"')")
rs.movenext
loop
set rs=nothing

case 5
set rs=conn.execute("select userid from [user]")
do while not rs.eof
conn.execute("insert into sms(fromuserid,touserid,content) values("&lguserid&","&rs("userid")&",'"&content2&"')")
rs.movenext
loop
set rs=nothing

end select
call send("群发留言成功。")
end if
case"table"
%><form method="POST" action="adminright3.asp?action=updatetable">
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#F4F6FC" width="100%">
  <tr>
    <td class=td3 width="100%" colspan="4" height="32" bgcolor="#F4F6FC">&nbsp;当前论坛已有的帖子数据表:</td>
  </tr>
  <tr class=td2>
    <td width="20%" height="28">&nbsp;数据表名称:</td>
    <td width="20%">&nbsp;帖数:</td>
    <td width="20%">&nbsp;默认使用:</td>
    <td width="40%">&nbsp;删除:(这样将删除相关的帖子)</td>
  </tr>
<%usedtable=application(prefix&"usedtable")
usedtable=split(usedtable,"|")
for i=1 to ubound(usedtable)
response.write"<tr class=td2><td width=20% height=28> bbs"&usedtable(i)&"</td><td width=20% > "&conn.execute("select count(bbsid) from bbs"&usedtable(i)&"")(0)&"</td><td width=20% > <input type=radio value='"&usedtable(i)&"'"
if int(usedtable(i))=checknum(application(prefix&"autotable")) then:response.write" checked ":end if
response.write"name='using'></td><td width=40% > <a href=adminright3.asp?action=deltable&totable="&usedtable(i)&"><img src=pic/del.gif border=0></a></td></tr>"
next
%>  <tr>
    <td class=td2 width="100%" colspan="4" height="32" bgcolor="#F4F6FC" align="center">
    <input type="submit" value="   确  认  修  改   " name="B1"></td>
  </tr>
</table></form><form method="POST" action="adminright3.asp?action=addtable">
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#F4F6FC" width="100%">
    <tr>
    <td class=td3 colspan=2></span>添加帖子数据表:</td>
  </tr>
  <tr>
    <td class=td2 width="100%" bgcolor="#F4F6FC" height="40">&nbsp;数据表名称:bbs <input type="text" name="table" size="5"> 
    (只填数字)
    <input type="submit" value="   确  认  添  加   " name="B1"></td>
  </tr>
</table></form>
<%case"updatetable"
usedtable=application(prefix&"usedtable")
using=checknum(request.form("using"))
usetable=using&"-"&usedtable
conn.execute("update config set usetable='"&usetable&"'")
call send("设定默认表成功。")
application(prefix&"autotable")=using
%>
<%case"addtable"
canadd=true
table=checknum(request.form("table"))
usedtable=application(prefix&"usedtable")
usedtable1=split(usedtable,"|")
for i=1 to ubound(usedtable1)
if table=int(usedtable1(i)) then
canadd=false
call send("·该表名已经被使用了<br>·<a href='javascript:history.go(-1)'><span class=errfont>返回重新填写</span></a>")
exit for
end if
next
if canadd=true then
sql="create table bbs"&table&" (bbsid int IDENTITY (1, 1) NOT NULL CONSTRAINT PrimaryKey PRIMARY KEY,id int default 0,bid int Default 0,userid int Default 0,content text,bd int Default 0,edittime datetime,type int Default 0,ip varchar(20))"
conn.execute(sql)
conn.execute("create index id on bbs"&table&" (id)")
conn.execute("create index bid on bbs"&table&" (bid)")
conn.execute("create index userid on bbs"&table&" (userid)")
conn.execute("create index bd on bbs"&table&" (bd)")
tablestr="|"&table
conn.execute("update config set usetable=usetable&'"&tablestr&"'")
application(prefix&"usedtable")=usedtable&tablestr
call send("已经成功添加帖子数据表 bbs"&table&" 。")
end if
%>
<%case"deltable"
totable=checknum(request.querystring("totable"))
autotable=checknum(application(prefix&"autotable"))
if totable=autotable then
call send("该表是默认使用的表,不能删除。")
else
conn.execute("delete*from Topic where totable="&totable&"")
conn.execute("drop table [bbs"&totable&"]")
usedtable=application(prefix&"usedtable")
usedtable=split(usedtable,"|")
for i=1 to ubound(usedtable)
if int(usedtable(i))<>totable then
tablestr=tablestr&"|"&usedtable(i)
end if
next
application(prefix&"usedtable")=tablestr
tablestr=autotable&"-"&tablestr
conn.execute("update config set usetable='"&tablestr&"'")
call send("已经成功的删除帖子数据表 bbs"&totable&" 。")
end if
%>
<%case"recycle"
dim str1,str2,topictype,pagesetup,count,totalpage,color,pagecount,value,ii,iii
topictype=checknum(request.querystring("topictype"))
totable=checknum(request.querystring("totable"))
if totable="" then totable=checknum(application(prefix&"autotable"))
usedtable=application(prefix&"usedtable")
usedtable=split(usedtable,"|")
for i=1 to ubound(usedtable)
color="#0466CC"
str1="<font color=#0466CC>话题</font>"
str2="<font color=#0466CC>回帖</font>"

if int(usedtable(i))=totable then
color="red"
if topictype=1 or topictype="" then
str1="<font color=red>话题</font>"
elseif topictype=2 then
str2="<font color=red>回帖</font>"
end if
end if

tablestr=tablestr&"·<a href=?action=recycle&totable="&usedtable(i)&"><b><font color="&color&">数据表 "&usedtable(i)&"</font></b></a> [<a href=?action=recycle&totable="&usedtable(i)&"&topictype=1>"&str1&"</a>][<a href=?action=recycle&totable="&usedtable(i)&"&topictype=2>"&str2&"</a>] "
next
response.write"<script language='javascript'>function Check(){var Name=document.form.topage.value;document.location='?action=recycle&topage='+Name+'&totable="&totable&"';}</script>"
%><SCRIPT language=JavaScript>
function CheckAll(form)  {
  for (var i=0;i<form.elements.length;i++){
    var e = form.elements[i];
    if (e.name != 'chkall')       e.checked = form.chkall.checked; 
   }
  }
</SCRIPT><SCRIPT src="inc/menu.js"></SCRIPT>

<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="100%" bgcolor="#F4F6FC" height="32">
  <tr>
    <td width="100%">&nbsp; <%=tablestr%></td>
  </tr>
</table>
<br>
<form method="POST" action="adminright3.asp?action=delbbsgg&totable=<%=totable%>&topictype=<%=topictype%>">
<table class=td3 border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" height="28" bordercolor="#F4F6FC">
  <tr>
    <td width="5%" align="center">选择</td>
    <td width="55%" align="center">主题</td>
    <td width="15%" align="center">作者</td>
    <td width="25%" align="center">发表时间</td>
  </tr>
</table>
<%
'_____________________________________________________________________________________________________________________________________________
Function pagination(pagecount)
   Dim wzpage,wzpagecount,pagenum,pagetemp
       If Len(Request.QueryString("page"))<>0 Then
          wzpage = clng(Request.QueryString("page"))
         Else 
          wzpage =1
       End If
       If wzpage <= 0 Then wzpage =1
       pagenum = (wzpage \ 10)*10+1
       If wzpage mod 10 = 0 Then pagenum = (wzpage \ 10)*10-9
       If wzpage > 10 Then
	        pagetemp=pagetemp&"<font face=""webdings"">"
            pagetemp=pagetemp&"<a href=""?bd="&bd&"&totable="&totable&"&action=recycle&page=1"" title=""首页"">9</a>"
			pagetemp=pagetemp&"<a href=""?bd="&bd&"&totable="&totable&"&action=recycle&page="& pagenum-1 &""" title=""前十页"">7</a>"
            pagetemp=pagetemp&"</font> "
	   End If
       For pagenum = pagenum To pagenum + 9
           If pagenum = wzpage Then
                  pagetemp=pagetemp&"<font color=""#ff0000"">"
                  pagetemp=pagetemp&" "& pagenum &" "
                  pagetemp=pagetemp&"</font>"
		      Else
                  pagetemp=pagetemp&" <a href=""?bd="&bd&"&totable="&totable&"&action=recycle&page="& pagenum &""">"
                  pagetemp=pagetemp&""& pagenum &""
                  pagetemp=pagetemp&"</a> "
			End If
         If pagenum >= pagecount Then Exit For
       Next
	    If wzpage < (pagecount - (pagecount \ 10))  Then
	        pagetemp=pagetemp&"<font face=""webdings"">"
            pagetemp=pagetemp&"<a href=""?bd="&bd&"&totable="&totable&"&action=recycle&page="& pagenum &"""  title=""后十页"">8</a>"
			pagetemp=pagetemp&"<a href=""?bd="&bd&"&totable="&totable&"&action=recycle&page="& pagecount &"""  title=""末页"">:</a>"
            pagetemp=pagetemp&"</font>"
	  End If
	  pagination=pagetemp
End Function

'_____________________________________________________________________________________________________________________________________________
dim wzcount,wzrep,wzpagecount,wzpage,pagestr

wzrep=30

if topictype=1 or topictype="" then
sql="select * from bbs"&totable&" where type=3 and bid=0"
elseif topictype=2 then
sql="select * from bbs"&totable&" where type=3 and bid<>0"
end if
set rs = server.createobject("adodb.recordset")
	rs.Open sql,conn,1
		if rs.eof or rs.bof then
			response.write"<div class=norecord>暂无记录</div>"
		else
		
			wzcount=rs.recordcount
			wzpagecount = abs(int(-abs(wzcount/wzrep)))
			wzpage = clng(request.querystring("page"))
			if len(wzpage) = 0 or wzpage = 0 then wzpage = 1
			rs.absoluteposition=rs.absoluteposition+((abs(wzpage)-1)*wzrep)
			pagestr="每页<font color=red>"&wzrep&"</font>条 共<font color=red>"&wzpagecount&"</font>页 ["&pagination(wzpagecount)&"]&nbsp;"
			response.write"<div class=pagestr>"&pagestr&"</div>"

			for i = 0 to wzrep-1
				if rs.eof then exit for


				content=rs("content")
				content=split(content,"|")
				if topictype=1 or topictype="" then
				value=rs("id")
				elseif topictype=2 then
				value=rs("bbsid")
				end if
%>
<table border="0" cellpadding="0" cellspacing="0" style='border-collapse: collapse; border-left-style: solid; border-left-width: 1; border-right-style: solid; border-right-width: 1; border-top-width: 1; border-bottom-style: solid; border-bottom-width: 1' width="100%" height="28">
  <tr>
    <td width="5%" align="center">
    <input type="checkbox" name="delbbsid" value="<%=value%>"></td>
    <td width="55%">&nbsp; <a href=# onclick=openscript('paper.asp?action=showdelbbs&bd=<%=rs("bd")%>&bbsid=<%=rs("bbsid")%>&totable=<%=totable%>')><%=lefttrue(checktitle(content(4)),40)%></a></td>
    <td width="15%" align="center"><%=checktitle(content(2))%></td>
    <td width="25%" align="center"><%=checktitle(content(5))%></td>
  </tr>
</table>
<%
				rs.movenext
			next
		end if
	rs.Close
set rs=nothing
response.write"<div class=pagestr>"&pagestr&"</div>"
%>
<table class=td1 border="0" cellpadding="0" cellspacing="0" style='border-collapse: collapse; ' width="100%" height="32" bgcolor="#F4F6FC">
  <tr>
    <td class=td3>
    &nbsp;<input onclick=CheckAll(this.form) type="checkbox"  name=chkall value="ON">全 选&nbsp;&nbsp;&nbsp;
<INPUT type=submit value=" 删除所选 " name=action onclick="{if(confirm('确定删除你所选择的帖子吗?')){return true;}return false;}"> <INPUT type=submit value=" 还原所选 " name=action onclick="{if(confirm('确定还原你所选择的帖子吗?')){return true;}return false;}"></td>
  </tr>
</table>
</form>

<%case"delbbsgg"
dim delidsql,delbidsql,delbbsid,baction,sql1,sql2
topictype=checknum(request.querystring("topictype"))
totable=checknum(request.querystring("totable"))
if totable="" then totable=checknum(application(prefix&"autotable"))

delbbsid=replace(","&request.form("delbbsid"),"'","")
delbbsid=split(delbbsid,",")

baction=replace(request.form("action"),"'","")

'============================================================================================
if baction=" 删除所选 " then

''''''''''''''''''''''''''''''''''''''''''''''''''''''''
if topictype=1 or topictype="" then
for i=1 to ubound(delbbsid)-1
delidsql=delidsql&"id="&delbbsid(i)&" or "
delbidsql=delbidsql&"bid="&delbbsid(i)&" or "
next
delidsql=delidsql&"id="&delbbsid(ubound(delbbsid))
delbidsql=delbidsql&"bid="&delbbsid(ubound(delbbsid))
if delidsql="id=" then delidsql="id=-1"
if delbidsql="bid=" then delbidsql="bid=-1"

sql1="delete*from topic where type=3 and ("&delidsql&")"
sql2="delete*from bbs"&totable&" where (type=3 and ("&delidsql&")) or ("&delbidsql&")"
conn.execute(sql1)
conn.execute(sql2)
end if
'''''''''''''''''''''''''''''''''''''''''''''''

'''''''''''''''''''''''''''''''''''
if topictype=2 then
for i=1 to ubound(delbbsid)-1
delidsql=delidsql&"bbsid="&delbbsid(i)&" or "
next
delidsql=delidsql&"bbsid="&delbbsid(ubound(delbbsid))
if delidsql="bbsid=" then delidsql="bbsid=-1"

sql1="delete*from bbs"&totable&" where type=3 and ("&delidsql&")"
conn.execute(sql1)
end if
''''''''''''''''''''''''''''''''''''
response.redirect "adminright3.asp?action=recycle&topictype="&topictype&""
end if
'=================================================================================================

'=================================================================================================

if baction=" 还原所选 " then
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
if topictype=1 or topictype="" then
for i=1 to ubound(delbbsid)-1
delidsql=delidsql&"id="&delbbsid(i)&" or "
next
delidsql=delidsql&"id="&delbbsid(ubound(delbbsid))
if delidsql="id=" then delidsql="id=-1"

sql1="update topic set type=0 where ("&delidsql&")"
sql2="update bbs"&totable&" set type=0 where ("&delidsql&")"
conn.execute(sql1)
conn.execute(sql2)
end if
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
if topictype=2 then
for i=1 to ubound(delbbsid)-1
delidsql=delidsql&"bbsid="&delbbsid(i)&" or "
next
delidsql=delidsql&"bbsid="&delbbsid(ubound(delbbsid))
if delidsql="bbsid=" then delidsql="bbsid=-1"
sql1="update bbs"&totable&" set type=0 where ("&delidsql&")"
conn.execute(sql1)
end if
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
response.redirect "adminright3.asp?action=recycle&topictype="&topictype&""

end if
'===========================

%>
<%end select
%></td>
  </tr>
</table>